package com.gezhi.stuserver.stumag.service.impl;

import com.gezhi.stuserver.bean.StudentBean;
import com.gezhi.stuserver.stumag.mapper.StudentMapper;
import com.gezhi.stuserver.stumag.service.IStudentService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * 学生业务功能接口实现类
 *
 * @author AWG
 */
@Service
public class StudentServiceImpl implements IStudentService {

    @Resource
    private StudentMapper studentMapper;

    /**
     * 新增学生
     *
     * @param studentBean 学生对象
     */
    @Override
    public void saveStudent(StudentBean studentBean) {
        studentMapper.saveStudent(studentBean);
    }

    /**
     * 修改学生
     *
     * @param studentBean 学生对象
     */
    @Override
    public void updateStudent(StudentBean studentBean) {
        studentMapper.updateStudent(studentBean);
    }

    /**
     * 删除学生
     *
     * @param studentBean 学生对象
     */
    @Override
    public void deleteStudent(StudentBean studentBean) {
        studentMapper.deleteStudent(studentBean);
    }

    /**
     * 根据学生ID查询学生
     *
     * @param id 学生ID
     * @return 学生对象
     */
    @Override
    public StudentBean getStudentById(Integer id) {
        return studentMapper.getStudentById(id);
    }

    /**
     * 查询所有的学生
     *
     * @return 所有的学生组成的List集合
     */
    @Override
    public List<StudentBean> findAllStudent() {
        return studentMapper.findAllStudent();
    }
}
